package com.caseProject.puremvc.command
{
	import com.caseProject.puremvc.model.DiagramNames;
	import com.caseProject.puremvc.model.ProjectProxy;
	import com.caseProject.puremvc.notifications.NotificationNames;
	
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	public class NewDiagramCommand extends SimpleCommand
	{
		public function NewDiagramCommand()
		{
			super();
		}
		
		override public function execute(notification:INotification):void
		{
			var projectProxy:ProjectProxy = this.facade.retrieveProxy(ProjectProxy.NAME) as ProjectProxy;
			
			switch (notification.getName())
			{
				case NotificationNames.NEW_DIAGRAM_STATE:					
					projectProxy.createDiagram(DiagramNames.STATE);
					break;
				
				case NotificationNames.NEW_DIAGRAM_ACTIVITY:
					projectProxy.createDiagram(DiagramNames.ACTIVITY); 
					break;
			}			
		}
	}
}